﻿using DoNet.Handlers.Commands;
using DoNet.Email;
using DoNet.Email.Entity;
using MediatR;

namespace DoNet.Handlers.Handlers
{
    public class SendMailCommandHandler : IRequestHandler<SendMailCommand, SendResultEntity>
    {
        public async Task<SendResultEntity> Handle(SendMailCommand request, CancellationToken cancellationToken)
        {
            return await SendMailHelper.SendMail(request._mailBodyEntity);
        }
    }
}
